/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mx.im.sinocab.dao;

import com.mx.im.sinocab.bean.User;
import com.mx.im.sinocab.util.Conection;
import com.mx.im.sinocab.util.Constant;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;

/**
 *
 * @author Javier Aviles Cruz
 */
public class AdminPermissionsDAO implements Constant {
    //u.idUser, u.user, u.expiry, ut.idUserType, ut.definition, ut.description, e.idEmploy, e.name, e.lastname, e.address, e.phone, e.email, e.birthday, e.gender

    private PreparedStatement stat;

    public ArrayList<User> listUsers() {
        Conection cone = new Conection();
        ArrayList<User> optionsList = new ArrayList<User>();

        try {
            stat = cone.getConection().prepareStatement(SQL_LIST_ALL_USERS);

            ResultSet result = stat.executeQuery();
            User user;
            while (result.next()) {

                user =
                        new User();

                optionsList.add(user);
            }

            if (stat != null) {
                stat.close();
            }

        } catch (Exception e) {} 
        finally {
            cone.closeConection();
            return optionsList;
        }
    }
}
